﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace bll
{
    /// <summary>
    /// clsUser: Klasse für Benutzer von TimeIt
    /// nur Attribute, keine Methoden
    /// </summary>
    public class clsTimeSheet
    {
        // private Attribute
        private int _id;
        private int _userId;
        private string _userName;
        private int _projectId;
        private string _projectName;
        private DateTime _date;
        private int _hours;
        private string _description;
        private bool _chargeable;
        private string _category;

        // Constructor (leer)
        public clsTimeSheet() {}

        // properties
        /// <summary>
        /// ID des User
        /// </summary>
        public int ID {
            get { return _id; }
            set { _id = value;}     
        }

        public int UserID {
            get { return _userId; }
            set { _userId = value; }
        }

        public int ProjectID {
            get { return _projectId; }
            set { _projectId = value; }
        }
  
        /// <summary>
        /// Datum der Stundenerfassung
        /// </summary>
        public DateTime Date
        {
            get { return _date; }
            set { _date = value; }
        }

        /// <summary>
        /// Stunden die der Mitarbeiter gearbeitet hat
        /// </summary>
        public int Hours
        {
            get { return _hours; }
            set
            {   if (value < 0)
                _hours = 0;  
                else
                _hours = value;
            }
        }

        /// <summary>
        /// Description of the type of work
        /// </summary>
        public String Description
        {
            get { return _description; }
            set
            {
                if (value != "")
                    _description = value;
                else
                    _description = "No Description";
            }
        }

        public bool Chargeable
        {
            get { return _chargeable; }
            set { _chargeable = value; }
        }

        /// <summary>
        /// Projectname of the Project
        /// </summary>
        public String ProjectName
        {
            get { return _projectName; }
            set
            {
                if (value != "")
                    _projectName = value;
                else
                    _projectName = "No ProjectName!";
            }
        }

        /// <summary>
        /// Category of the work
        /// </summary>
        public String Category
        {
            get { return _category; }
            set
            {
                if (value != "")
                    _category = value;
                else
                    _category = "No Category!";
            }
        }

        /// <summary>
        /// Username who has created the timesheet
        /// </summary>
        public String UserName
        {
            get { return _userName; }
            set
            {
                if (value != "")
                    _userName = value;
                else
                    _userName = "No Name";
            }
        }
    } // clsTimeSheet
}
